#!/usr/bin/env python3
# coding:utf-8
import requests
import json
# server_url = 'http://0.0.0.0:8080/core/user/'
server_url = 'http://0.0.0.0:8090/core/project_item/'

def get_sensors_by_project_item_id():
    data = {'project_item_id': 6, }
    url = server_url + 'get_sensors_by_project_item_id/'
    headers = {'Content-Type': 'application/json'}
    r = requests.post(url, json=data, headers=headers)
    print(type(r))
    print(r.json())

def update_sensor_to_project_item():
    data = {'project_item_id': 6, 'sensors':[1,2,3]}
    url = server_url + 'update_sensor_to_project_item/'
    headers = {'Content-Type': 'application/json'}
    r = requests.post(url, json=data, headers=headers)
    print(type(r))
    print(r.json())

get_sensors_by_project_item_id()
# update_sensor_to_project_item()